package com.springcloudalibaba.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: TongRui乀
 * @Date: 2019-11-25 17:37
 * @description：
 */
@RestController
@RequestMapping("sentinel")
public class WebController {



    @SentinelResource("test")
    @GetMapping("test")
    public String test(){
        return "success" + test2();
    }

    @SentinelResource("test1")
    @GetMapping("test1")
    public String test1(){
        return "error" + test2();
    }

    @SentinelResource("test2")
    public String test2(){
        return "chain----> 2";
    }


}
